package cn.miju.admin.biz.vo;

import cn.miju.admin.framework.model.BaseInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <pre>
 * 商户详情
 * </pre>
 *
 * @author zhuming
 * @version 1.0.0
 * @since 2023-04-28 9:26
 */
@Data
@Builder
@ApiModel
@NoArgsConstructor
@AllArgsConstructor
public class MerchantDetailOutVO {
    /**
     * 商户ID
     */
    @ApiModelProperty(value = "商户ID")
    private Long id;
    /**
     * 商户名
     */
    @ApiModelProperty(value = "商户名", required = true)
    @NotBlank(message = "传入商户名不能为空")
    private String merchantName;
    /**
     * 商户类型
     */
    @ApiModelProperty(value = "商户类型", required = true)
    @NotBlank(message = "传入商户类型不能为空")
    private String merchantType;
    /**
     * 支付结果通知URL
     */
    @ApiModelProperty(value = "支付结果通知URL")
    private String payNotifyUrl;
    /**
     * 退款结果通知URL
     */
    @ApiModelProperty(value = "退款结果通知URL")
    private String refundNotifyUrl;
    /**
     * 是否返回服务商单号;0：否 1：是，默认0表示返回平台单号
     */
    @ApiModelProperty(value = "是否返回服务商单号", required = true)
    @NotNull(message = "传入是否返回服务商单号不能为空")
    private boolean toMerchantTradeNo;

    /**
     * 支付宝支付配置参数
     */
    @ApiModelProperty(value = "支付宝支付配置参数")
    private MDAlipayProperties alipayProperties;
    /**
     * 银联支付配置参数
     */
    @ApiModelProperty(value = "银联支付配置参数")
    private MDUnionPayProperties unionPayProperties;

    /**
     * 支付宝商户配置参数
     */
    @Data
    @Builder
    @AllArgsConstructor
    public static class MDAlipayProperties {
        /**
         * 商户号
         */
        @ApiModelProperty(value = "商户号", required = true)
        @NotBlank(message = "传入商户号不能为空")
        private String merchantNo;
        /**
         * 应用ID
         */
        @ApiModelProperty(value = "应用ID", required = true)
        @NotBlank(message = "传入应用ID不能为空")
        private String appId;
        /**
         * 应用公钥
         */
        @ApiModelProperty(value = "应用公钥", required = true)
        @NotBlank(message = "传入应用公钥不能为空")
        private String appPublicKey;
        /**
         * 应用私钥
         */
        @ApiModelProperty(value = "应用私钥", required = true)
        @NotBlank(message = "传入应用私钥不能为空")
        private String appPrivateKey;
        /**
         * 支付宝公钥
         */
        @ApiModelProperty(value = "支付宝公钥", required = true)
        @NotBlank(message = "传入支付宝公钥不能为空")
        private String alipayPublicKey;
        /**
         * 支付宝网关
         */
        @ApiModelProperty(value = "支付宝网关", required = true)
        @NotBlank(message = "传入支付宝网关不能为空")
        private String serverUrl;
        /**
         * 是否正式环境;
         * 沙箱测试环境不支持设置二维码超时时间
         */
        @ApiModelProperty(value = "是否正式环境", required = true)
        @NotNull(message = "传入是否正式环境不能为空")
        private boolean prodEnv;
    }

    /**
     * 银联商户配置参数
     */
    @Data
    @Builder
    @AllArgsConstructor
    public static class MDUnionPayProperties {
        /**
         * 商户号
         */
        @ApiModelProperty(value = "商户号", required = true)
        @NotBlank(message = "传入商户号不能为空")
        private String merchantNo;
        /**
         * 服务地址
         */
        @ApiModelProperty(value = "服务地址", required = true)
        @NotBlank(message = "传入服务地址不能为空")
        private String serviceUrl;
        /**
         * 签名证书路径
         */
        @ApiModelProperty(value = "签名证书路径", required = true)
        @NotBlank(message = "传入签名证书路径不能为空")
        private String signCertPath;
        /**
         * 签名证书密码
         */
        @ApiModelProperty(value = "签名证书密码", required = true)
        @NotBlank(message = "传入签名证书密码不能为空")
        private String signCertPwd;
        /**
         * 验签证书路径
         */
        @ApiModelProperty(value = "验签证书路径", required = true)
        @NotBlank(message = "传入验签证书路径不能为空")
        private String validateCertPath;
    }
}
